home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / misc_pto / bcolor20 / clrauto.m < prev    next >
Text File  |  1988-12-16  |  4KB  |  129 lines

  1. ;************************************************************************
  2. ;**                  for   B R I E F   ver. 2.1                         *
  3. ;**                                                                     *
  4. ;**   Clrauto Macro - Change the status of Automatic Color Generation   *
  5. ;**                                                                     *
  6. ;**         By Tom Bentley     December 1988     Ver. 2.0               *
  7. ;**                                                                     *
  8. ;**                 (C) Copyright - All rights reserved                 *
  9. ;**                                                                     *
  10. ;************************************************************************
  11.  
  12. #include "dialog.h"
  13.  
  14. (extern auto_color_flag window_color_flag clr_button_text clr_flag)
  15.  
  16. (macro clrauto
  17.    (
  18.       (int       curr_buff ac_buf_id backup_status)
  19.       (int       clr_chg_auto clr_chg_window)
  20.       (string    env_help insert_string)
  21.  
  22.       (global    clr_chg_auto clr_chg_window)
  23.  
  24.       (= clr_chg_auto auto_color_flag)
  25.       (= clr_chg_window window_color_flag)
  26.       (= clr_flag 0)
  27.       (= curr_buff (inq_buffer))
  28.       (= ac_buf_id (create_buffer "clrauto.box" NULL 0))
  29.       (set_buffer ac_buf_id)
  30.       (top_of_buffer)
  31.       (insert "T (3,5) \"Auto Color?\"\n")
  32.       (if (== auto_color_flag 0)
  33.          (
  34.             (insert "L (3,18) \"On(Off)\"\n")
  35.          )
  36.       ;else
  37.          (
  38.             (insert "L (3,18) \"(On)Off\"\n")
  39.          )
  40.       )
  41.       (insert "T (5,3) \"Auto Windows?\"\n")
  42.       (switch window_color_flag
  43.        0
  44.          (
  45.             (insert "L (5,18) \"(None)Color\tBrief\"\n")
  46.          )
  47.        1
  48.          (
  49.             (insert "L (5,18) \"None(Color)Brief\"\n")
  50.          )
  51.        2
  52.          (
  53.             (insert "L (5,18) \"None\tColor(Brief)\"")
  54.          )
  55.       )
  56.       (set_buffer curr_buff)
  57.       (_process_dialog_box 10 18 47 10 "Set Auto Clr" "F10 to Set"
  58.           NULL ac_buf_id "auto_clr_action")
  59.       (delete_buffer ac_buf_id)
  60.       (if (== clr_flag 0)
  61.          (
  62.             (return 0)
  63.          )
  64.       )
  65.       (= env_help (inq_environment "BHELP"))
  66.       (= ac_buf_id (create_buffer "clrauto.rst"
  67.          (+ env_help "\\clrauto.rst") 0))
  68.       (set_buffer ac_buf_id)
  69.       (while (! (inq_position 1 3))
  70.          (
  71.             (delete_line)
  72.          )
  73.       )
  74.       (goto_line 1)
  75.       (delete_to_eol)
  76.       (sprintf insert_string "%d%d" auto_color_flag window_color_flag)
  77.       (insert insert_string)
  78.       (= backup_status (set_backup 0))
  79.       (write_buffer)
  80.       (set_backup backup_status)
  81.       (set_buffer curr_buff)
  82.       (delete_buffer ac_buf_id)
  83.       (return 1)
  84.    )
  85. )
  86.  
  87. (macro auto_clr_action
  88.    (
  89.       (int   event_type line_no)
  90.  
  91.       (get_parm 0 event_type)
  92.       (switch event_type
  93.         DIALOG_EXIT_LIST
  94.          (
  95.             (get_parm 1 line_no)
  96.             (get_parm 2 clr_button_text)
  97.             (if (== line_no 3)
  98.                (
  99.                   (if (== clr_button_text "On")
  100.                      (= clr_chg_auto 1)
  101.                   ;else
  102.                      (= clr_chg_auto 0)
  103.                   )
  104.                )
  105.             ;else
  106.                (
  107.                   (if (== clr_button_text "None")
  108.                      (= clr_chg_window 0)
  109.                   )
  110.                   (if (== clr_button_text "Color")
  111.                      (= clr_chg_window 1)
  112.                   )
  113.                   (if (== clr_button_text "Brief")
  114.                      (= clr_chg_window 2)
  115.                   )
  116.                )
  117.             )
  118.          )
  119.         DIALOG_F10
  120.          (
  121.             (= auto_color_flag clr_chg_auto)
  122.             (= window_color_flag clr_chg_window)
  123.             (= clr_flag 1)
  124.          )
  125.       )
  126.       (return TRUE)
  127.    )
  128. )
  129.